package com.zzyl.service;

import com.aliyun.iot20180120.models.DeleteDeviceRequest;
import com.aliyun.iot20180120.models.QueryDeviceDetailRequest;
import com.aliyun.iot20180120.models.QueryDevicePropertyStatusRequest;
import com.aliyun.iot20180120.models.QueryThingModelPublishedRequest;
import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDto;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.vo.DeviceVo;
import com.zzyl.vo.ProductVo;

import java.util.List;

public interface DeviceService {
    /**
     * 从物联网平台获取所有的产品, 并缓存到redis
     */
    void syncProductList() throws Exception;

    /**
     * 查询redis中缓存的所有产品信息
     * @return
     */
    List<ProductVo> allProduct();

    /**
     * 注册设备到物联网平台
     * @param deviceDto
     * @return
     */
    void registerDevice(DeviceDto deviceDto) throws Exception;

    /**
     * 分页查询
     * @param devicePageQueryDto
     * @return
     */
    PageResponse<DeviceVo> selectPage(DevicePageQueryDto devicePageQueryDto);

    /**
     * 查询设备详细信息
     * @param request
     * @return
     */
    DeviceVo queryDeviceDetail(QueryDeviceDetailRequest request) throws Exception;

    /**
     * 查看指定产品的已发布物模型中的功能定义详情
     * @param request
     * @return
     */
    ResponseResult queryThingModelPublished(QueryThingModelPublishedRequest request) throws Exception;

    /**
     * 查询指定设备的物模型运行状态
     * @param request
     * @return
     */
    ResponseResult queryDevicePropertyStatus(QueryDevicePropertyStatusRequest request) throws Exception;

    /**
     * 修改设备备注名称
     * @param dto
     */
    void updateDevice(DeviceDto dto) throws Exception;

    /**
     * 删除设备
     * @param request
     */
    void deleteDevice(DeleteDeviceRequest request) throws Exception;
}
